const express = require('express');
const router = express.Router();
const {checkUser, createUser, updateUserById, findUserByNicName} = require('../service/UsersService')

/**
 * baseUrl:"/users"
 */
class UsersController {
  static initRouter() {
    //验证用户
    router.post('/check_user', checkUser);

    //添加用户
    router.post('/create_user', createUser);

    //根据id修改用户信息
    router.put('/:id', updateUserById)

    //根据昵称模糊查找用户
    router.get('/search', findUserByNicName)

    return router
  }
}

module.exports = UsersController.initRouter()
